﻿/**********************************************************************************
 * Project Name   :   
 * Remarks        :  
 * Interface Name :  IDataProvider   
 * Version        :  v1.0.0.0 
 * Author         :  Joey Liang 
 * Description    : 
 * Created Time   :  2013/8/14 22:28:17
 * Update Man     :  Joey Liang
 * Update Time    :  2013/8/14 22:28:17
************************************************************************/

using JoeyLibs.IdleStartMenu.Model;
using System;
using System.Collections.Generic;
using System.Linq;

namespace JoeyLibs.IdleStartMenu.Interfaces
{
    public interface IDataProvider
    {
        /// <summary>
        /// 获取配置的所有进程
        /// </summary>
        IList<ProcessModel> Processes { get; }

        /// <summary>
        /// 查找满足条件对象
        /// </summary>
        ProcessModel GetProcess(Func<ProcessModel, bool> func);

        /// <summary>
        /// 查找满足条件的对象集合
        /// </summary>
        IList<ProcessModel> GetProcesses(Func<ProcessModel, bool> func);

        /// <summary>
        /// 配置添加一个进程
        /// </summary>
        /// <param name="model"></param>
        void AddProcess(ProcessModel model, bool isSave = true);

        /// <summary>
        /// 配置更新一个进程
        /// </summary>
        /// <param name="model"></param>
        void EditProcess(ProcessModel model, bool isSave = true);

        /// <summary>
        /// 配置删除进程
        /// </summary>
        /// <param name="model"></param>
        void DelProcess(ProcessModel model, bool isSave = true);

        /// <summary>
        /// 提交所有更新
        /// </summary>
        void SaveChanges();
    }
}
